<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');
need_login();
need_admin();

if ( $_POST ) {
	$table = new Table('user', $_POST);
	$table->status = 0;
    $table->password = ZUser::GenPassword($_POST['password']);
	$table->insert(array(
		'create_time', 'username', 'password', 'realname', 'gender', 'mobile', 'email', 'qq', 'address',
	));
	Session::Set('notice', '新增员工成功!');
    if($_POST['list_post']){
        die("<script>parent.location.reload();</script>");
    }
	redirect( WEB_ROOT . '/index.php');
}